#!/usr/bin/env python
# coding: utf-8

""" 
服务的入口

"""
from tornado.ioloop import IOLoop
from loguru import logger

from router import kafak_worker,router
from config import load_config
config_param = load_config()

def main():
    logger.info("service starting")
    # 启动订阅kafka topic
    kafak_worker.subscribe(config_param["kafka"]["subscribe_topic"],router.service)
    IOLoop.instance().start()

if __name__ == '__main__':
    main()
